package com.pattern.flyweight;

/**
 * @author 冯志立
 * @create 2019-11-04 10:56
 */
public class Client {
    public static void main(String[] args) {
        WebSiteFactory siteFactory = new WebSiteFactory();

        //客户要一个以新闻形式发布的网站
        WebSite webSite1 = siteFactory.getWWebSiteCatrgory("新闻");
        webSite1.use(new User("tom"));

        WebSite webSite2 = siteFactory.getWWebSiteCatrgory("博客");
        webSite2.use(new User("jerry"));

        WebSite webSite3 = siteFactory.getWWebSiteCatrgory("博客");
        webSite3.use(new User("jack"));

        WebSite webSite4 = siteFactory.getWWebSiteCatrgory("博客");
        webSite4.use(new User("smith"));


        System.out.println("网站的分类共 = "+ siteFactory.getWebSiteCount());
    }
}
